<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
<script>
    //方式1：利用parseInt()将字符串转换成整数
    console.log(parseInt('13.14'));
    console.log(typeof parseInt('13.14'));

    //方式2：利用parseFloat()将字符串转换成浮点数
    console.log(parseFloat('78'));
    console.log(typeof parseFloat('78'));

    //方式3：利用Numbert()将字符串转换成数字型
    console.log(Number('13.14'));
    console.log(typeof Number('13.14'));

    //方式4：利用算术运算符(+,-,*)隐式转换
    console.log('78'- 1);
    console.log(typeof '78'- 1);
</script>
</head>
<body>
    
</body>
</html>